package com.xsy.android.compose.wandroid.logic.network

import com.xsy.android.compose.wandroid.logic.network.service.HomePageService
import com.xsy.android.compose.wandroid.logic.network.service.LoginService
import com.xsy.android.compose.wandroid.logic.network.service.OfficialService
import com.xsy.android.compose.wandroid.logic.network.service.ProjectService

/**
 *@author: xiaosy
 *时间: 2024/7/8
 *@Description: java类作用描述
 *@Version: 1.0
 **/
object Network {
    private val homePageService = ServiceCreator.create(HomePageService::class.java)

    suspend fun getBanner() = homePageService.getBanner()

    suspend fun getArticle(page: Int) = homePageService.getArticle(page)

    private val loginService = ServiceCreator.create(LoginService::class.java)

    suspend fun getLogin(username: String, password: String) =
        loginService.getLogin(username, password)

    suspend fun getRegister(username: String, password: String, rePassword: String) =
        loginService.getRegister(username, password, rePassword)

    suspend fun getLogout() = loginService.getLogout()

    private val officialService = ServiceCreator.create(OfficialService::class.java)

    suspend fun getWxArticleTree() = officialService.getWxArticleTree()

    suspend fun getWxArticle(page:Int, cid:Int) = officialService.getWxArticle(page, cid)

    private val projectService = ServiceCreator.create(ProjectService::class.java)

    suspend fun getProjectTree() = projectService.getProjectTree()

    suspend fun getProject(page:Int, cid:Int) = projectService.getProject(page, cid)

}